require 'rake'
require 'rake/rdoctask'

task :doc do
  require 'rdoc/rdoc'
  rdoc = RDoc::RDoc.new
  options = [] <<
    # set main page to README
    '--main' << 'README' << 
    # include readme
    'README' <<
    'TODO' <<
    # include files under this dir
    '.' << 
    # set title
    '--title' << 'Drunken Master' <<
    # set ouput dir to doc
    '-o' << 'doc' <<
    # no tests
    '-x' << 'test\\.rb$|test' <<
    # rebuild even if no changes were made
    '--force-update'
  
  # show how the command would look
  puts 'rdoc '+options.join(' ')
  
  #perform the command
  rdoc.document(options)
end
